﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PrVyd.Zakladni_tridy
{
    class Invoice
    {
        public long Number;
        public DateTime Due;
        public DateTime Created;
        public Person Customer;
        public Person Supplier;
        public List<Item> Items;
        public Decimal TotalAmount
        {
            get
            {
                decimal amount = 0;
                foreach (var item in Items)
                    amount += item.Count * item.Price;

                return amount;
            }
        }

        public Invoice()
        {
            Items = new List<Item>();
        }
    }


}
